Repository navigation
feat(annotate): carry agent-facing element context on HTML and live-app pinpoints - #1517
Merged
Merged
Conversation
…pp pinpoints
A pinpointed element exported as a one-word placeholder ('[element:
Navigation]') or its flattened textContent. The bridge now captures a
bounded description at click time (tag, id, classes, ancestor path, role,
accessible name, allowlisted attributes, rendered text, an adaptive HTML
skeleton, box, landmark, heading, component hint, live route) as
elementContext; the parent re-validates and re-caps it; the export prints
a fenced skeleton plus selector/path/role/name lines under the comment;
the annotation panel gains a per-row Copy for element-bearing cards; the
feedback archive records element identity. Additive: annotations without
the field export byte-identically, share links drop it, no protocol bump.
This was referenced Sep 12, 2026
backnotprop
added a commit
that referenced
this pull request
Sep 12, 2026
* fix(ui): remove the annotation panel's per-row Copy button The panel's card chrome goes back to Edit and Delete. The element context still rides every HTML and live-app pinpoint into the exported feedback; exportAnnotationEntry stays as a pure helper for hosts and tests. * chore(ui): bump @plannotator/ui to 0.39.0 Element context on HTML and live-app pinpoints (#1517, #1520). Core stays 0.25.2; peer ranges unchanged from 0.38.2.
This was referenced Sep 15, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Pinpointing an element in a raw-HTML or live-app annotate session exported either the bridge's placeholder quote (
Feedback on: "[element: Navigation]") or the element's flattenedtextContent. The bridge already built a unique selector, tag and text snapshot, then nothing in the export read them. An agent reading the feedback could not tell which element the comment was about. Investigation and design:DESIGN_html-annotation-context.md/.html(untracked, repo root).What ships
Capture (bridge,
buildElementContext), at click time, since only the bridge can see the DOM and an SPA may have replaced the element by submit:tagidclassespathrolename<label for>→ own short textattrsdata:keeps its media type,javascript:droppedtextinnerText, whitespace-collapsed, word-boundary cutoutlinechildrenrectlandmarkheadingcomponentdata-component/data-testidancestor (no React fiber reads)pageHard cap 2 KiB serialized per primary, 1 KiB per shift-click extra target, shedding outline → text → attrs → classes → path → heading → landmark → component. Never captured: form values,
on*,style, script/style/template contents, full innerHTML, viewer overlays. A 400-row list costs the same bytes as a chip (pinned by test).Trust boundary (
parseHtmlElementContext): re-collapses every scalar (newlines → markdown structure), re-applies every cap and the allowlist, drops unknown keys, defuses 3+ backtick runs in the outline, re-enforces the byte bound. A malformed context is dropped, never fatal to the selection.Export (
elementContextExportBlock): under the comment, a 4-backtickhtmlfence of the skeleton plusselector/path/role·name·component/attrs/text/box/nearlines. A text-less pinpoint's placeholder heading becomesFeedback on the <nav> element — "Primary"; a pinpoint with real quoted text keeps its quote line and gains the block. Extra targets listselector · pathon their existing one-liner. Grouped live-app export omits the route (the## Page:heading carries it); the single-entry form includes it.nav#site-navbody > div#root > header.site-header > nav#site-navdata-component=AppNavaria-label="Primary" data-component="AppNav"